import { IToolTipItem } from "../../../../../com/mui/manager/IToolTipItem";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../../extend/language/Language";
import { ToolTipsManager } from "../../../../../com/mui/manager/ToolTipsManager";
//class ShowBtn
    
    export  class ShowBtn /* flash.display.Sprite */ implements IToolTipItem
    {
        constructor()
        {
            
            mouseChildren = false;
            buttonMode = true;
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            this._hideBtn = GlobalClass.getInstance("showBtn");
            this._hideBtn.width = 24;
            this._hideBtn.height = 22;
            addChild(this._hideBtn);
            this._bg = GlobalClass.getBitmap(ImagesConst.trackbg);
            this._bg.x = (-this._hideBtn.width) / 2;
            this._bg.y = (-this._hideBtn.height) / 2;
            addChild(this._bg);
            this.show = true;
            return;
        }

        public set show(arg1: Boolean)
        {
            if (arg1) 
            {
                this.toolTipData = HTMLUtil.addColor(Language.getString(20705), "#ffffff");
                this._hideBtn.scaleX = 1;
                if (contains(this._bg)) 
                {
                    removeChild(this._bg);
                }
            }
            else 
            {
                this.toolTipData = HTMLUtil.addColor(Language.getString(20706), "#ffffff");
                this._hideBtn.scaleX = -1;
                if (!contains(this._bg)) 
                {
                    addChildAt(this._bg, 0);
                }
            }
            return;
        }

        public get toolTipData()
        {
            return this._tooltipData;
        }

        public set toolTipData(arg1)
        {
            if (arg1 == null || arg1 == "") 
            {
                ToolTipsManager.unregister(this);
            }
            else 
            {
                ToolTipsManager.register(this);
            }
            this._tooltipData = arg1;
            return;
        }

        /* internal */ /* var */_hideBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_tooltipData;
    }
